<?php
/**
 * Created by PhpStorm.
 * User: zsd
 * Date: 2018/5/3
 * Time: 下午2:11
 */
namespace backend\controllers;

use backend\models\UploadForm;
use yii\web\UploadedFile;

class FileController extends BaseController
{
    public function verbs()
    {
        return [
            'upload-image' => ['post'],
        ];
    }

    /**
     * 上传图片
     */
    public function actionUploadImage()
    {
        $model       = new UploadForm();
        $model->file = UploadedFile::getInstanceByName('file');

        return $model->upload();
    }
}
